from flask import Flask
from flask import request

app = Flask(__name__)

@app.route('/postandget',methods=['GET','POST'])

def getandpost():
    method = request.method
    if method == 'GET':
        user_name = request.args['user_Name']
        pwd = request.args['PWD']
        return '您好，%s,欢迎使用get请求测试验证'%(user_name)
    else:
        user_name = request.form['user_Name']
        pwd = request.form['PWD']
        return '您好，%s,欢迎使用post请求测试验证'%(user_name)

if __name__ == '__main__':
    app.run('127.0.0.1',5010,debug=True)